<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02Demo</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<h1 id="app">{{msg}}</h1>
<script type="text/javascript">
    var app = new Vue({
        el: "app",
        data: {
            msg: "Hello world"
        },
        create() {
            console.log("this is created hook function");
            this.msg = "Goodbye world";
            console.log(this);
        },
        update() {
            console.log("this is updated hook function:" + this.msg);
        }
    })
</script>
</body>
</html>